#region Using

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;

using Gizmox.WebGUI.Common;
using Gizmox.WebGUI.Forms;

#endregion

namespace Bronze.ReportBuilder
{
    public partial class BaseDialogForm : Form
    {
        EventHandler ResultHanlder;
        public BaseDialogForm()
        {
            InitializeComponent();
        }

        public void ShowWndDialog(EventHandler resultHanlder)
        {
            ResultHanlder = resultHanlder;
            this.ShowDialog();
        }

        protected override void OnClosed(EventArgs e)
        {
            if (ResultHanlder != null)
            {
                ResultHanlder(this, EventArgs.Empty);
            }
            base.OnClosed(e);
        }
      

        public void OKAndClose()
        {
            this.DialogResult = Gizmox.WebGUI.Forms.DialogResult.OK;
            this.Close();
        }

        public void CancelAndClose()
        {
            this.DialogResult = Gizmox.WebGUI.Forms.DialogResult.Cancel;
            this.Close();
        }
    }
}